<html><head lang="en">
    <title>首页</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="/js/bootstrap/css/bootstrap.min.css">
    <script src="/js/jquery/jquery.min.js"></script>
    <script src="/js/bootstrap/js/bootstrap.min.js"></script>
    <script src="/js/plugins/jrender/jrender.js"></script>
    <link rel="stylesheet" href="/css/font/css/font-awesome.min.css">
    <link rel="stylesheet" href="/css/reset.css">
    <link rel="stylesheet" href="/css/index.css">
    <script>
        $(function () {
            showComments();
			//==================================
            //发送ajax请求,获取每周推荐的内容
            $.get("/travels/commends", {type: 1}, function (data) {
                $("#travelsCommends").renderValues({list: data}, {
                    handle: function (ele, value) {
                        ele.href = "/travelContent.html?id="+value;
                    }
                });
                //显示第一个推荐
                $("#travelsCommends .carousel-inner > div:first").addClass("active");
            }, "json");

            //发送ajax请求,获取每日头条的内容
            $.get("/news",{state:1},function (data) {
               $("#bigger").renderValues(data.list[0],{
                    handle: function (ele,value) {
                        ele.href = "/newsContent.html?id=" + value;
                    }
                });
            }, "json");


            //查询余下9个每日头条
            $.get("/smallerNews", {state:1},function (data) {
                $(".smaller").renderValues({list:data}, {
                    handle: function (ele, value) {
                        ele.href = "/newsContent.html?id=" + value;
                    }
                });
            }, "json")

            //查询功能
            $(".searchBtn").blur(function () {
                var keyword = $(".searchBtn").val();
                if (keyword == "攻略" ){
                    location.href="/strategyPage.html";
                }else if (keyword == "游记") {
                    location.href="/travelPage.html";
                }else if (keyword == "资讯") {
                    location.href="/newsPage.html";
                }else {
                    location.href="/index.html";
                }
            })

            //显示相关推荐
            $.get("/dailys", {state: 1,pageSize:100}, function (data) {
                $("#dailyExampleControls").renderValues(data, {
                    handle: function (ele, value) {
                        ele.href = "/newsContent.html?id="+value;
                    }
                });
                $("#allDaily > div:first").addClass("active");
            }, "json");


        });

        function showComments() {
            var Mar = document.getElementsByClassName("Marquee")[0];
            var child_div = Mar.getElementsByTagName("div");
            var picH = 50;//移动高度
            var scrollstep = 3;//移动步幅,越大越快
            var scrolltime = 20;//移动频度(毫秒)越大越慢
            var stoptime = 3000;//间断时间(毫秒)
            var tmpH = 0;
            Mar.innerHTML += Mar.innerHTML;

            function start() {
                if (tmpH < picH) {
                    tmpH += scrollstep;
                    if (tmpH > picH) tmpH = picH;
                    Mar.scrollTop = tmpH;
                    setTimeout(start, scrolltime);
                } else {
                    tmpH = 0;
                    Mar.appendChild(child_div[0]);
                    Mar.scrollTop = 0;
                    setTimeout(start, stoptime);
                }
            }

            setTimeout(start, stoptime);
        }
    </script>
</head>

<body>

<div class="body">
    <input type="checkbox" id="menu">

    <label for="menu" class="menu">
        <span><i class="fa fa-user fa-fw fa-2x"></i></span>
        <span><i class="fa fa-chevron-left fa-fw fa-2x" style="color: #3E3C3B"></i></span>
    </label>

    <!-- 侧边栏 -->
    <div class="nav">
        <iframe id="ipage" src="/mine/simpleProfiles.html" frameborder="0" width="90%"></iframe>
    </div>

    <div class="search-head">
        <div class="row nav-search">
            <div class="col-2">
                <a href="index.html">
                    <span><i class="fa fa-chevron-left fa-2x"></i></span>
                </a>
            </div>
            <div class="col-10">
                <div class="input-group-sm search">
                    <input class="form-control searchBtn" placeholder="搜索旅行攻略、日记和旅游资讯">
                </div>
            </div>
        </div>
    </div>

    <div class="container">
        <h6 class="module-title">每周推荐</h6>
        <div id="carouselExampleControls" class="carousel slide" data-ride="carousel">
            <div id="travelsCommends">
                <div class="carousel-inner" render-loop="list">
                    <!-- 轮播图的内部 -->
                    <div class="carousel-item">
                        <a render-fun="handle" render-key="list.travelId">
                            <img class="d-block w-100" render-src="list.coverUrl" width="100%" height="200px">
                            <span class="recommend" render-html="list.title"></span>
                        </a>
                    </div>
                </div>
            </div>
            <a class="carousel-control-prev" href="#carouselExampleControls" role="button" data-slide="prev">
                <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                <span class="sr-only"></span>
            </a>
            <a class="carousel-control-next" href="#carouselExampleControls" role="button" data-slide="next">
                <span class="carousel-control-next-icon" aria-hidden="true"></span>
                <span class="sr-only"></span>
            </a>
        </div>
        <hr>

        <div class="row nav-box">
            <div class="col" style="background-color: #DFE823;" align="center">
                <a href="strategyPage.html"><i class="fa fa-plane fa-fw"></i> 找攻略</a>
            </div>
            <div class="col" style="background-color: #7281D5;" align="center">
                <a href="travelPage.html"><i class="fa fa-book fa-fw"></i> 看游记</a>
            </div>
        </div>
        <!--跳转到酒店和购票的按钮-->
        <div class="row nav-box">
            <div class="col" style="background-color:#74d2d9;" align="center">
                <a href="travelPage.html"><i class="fa fa-book fa-fw"></i> 住酒店</a>
            </div>
            <div class="col" style="background-color: #c82333;" align="center">
                <a href="ticket.html"><i class="fa fa-book fa-fw"></i> 买门票</a>
            </div>
        </div>

        <div class="row dynamic " id="comments">
            <div class="col-1" style="padding: 0px;">
                <img class="rounded" src="/img/topComment.png" style="width: 50px;">
            </div>
            <div class="col lamps">
                <div class="Marquee" render-loop="list">
                    <div class="d-flex">
                        <a href="/userProfiles.html" render-key="list.userId" render-fun="handle">
                            <img class="rounded-circle dynamic-head" render-src="list.uheadImgUrl">
                        </a>
                        <a href="/strategyComment.html" class="dynamic-detail" render-key="list.id" render-fun="handleComment">
                            <span render-html="list.unickName"></span> 点评了攻略<p render-html="list.stitle"></p>
                        </a>
                    </div>

				</div>
            </div>
        </div>
    </div>
<script>
    $(function () {
        //轮播列表
        $.get("/comments",{myType:"all"},function (data) {
            console.log(data);
            $(".lamps").renderValues(data,{
                handle: function (ele, value) {
                    ele.href = "/userProfiles.html?id="+value;
                },handleComment: function (ele, value) {
                    ele.href = "/strategyComment.html?id="+value;
                }

            })
        })

    })
</script>
    <div class="row nav-pills">
        <div class="col" style="background-color: #e9e7ff;" align="center">
            <a href="dailyPage.html"><i class="fa fa-reply-all fa-fw"></i> 所有</a>
        </div>
        <div class="col" style="background-color: #2AFF30;" align="center">
            <a href="sceneryPage.html"><i class="fa fa-tree fa-fw"></i> 风景</a>
        </div>
        <div class="col" style="background-color: #9BA2FF" align="center">
            <a href="catePage.html"><i class="fa fa-apple fa-fw"></i> 美食</a>
        </div>
        <div class="col" style="background-color: #FF5788" align="center">
            <a href="celebrityPage.html"><i class="fa fa-user fa-fw"></i> 名人</a>
        </div>
        <div class="col" style="background-color: #D52A41;" align="center">
            <a href="militaryPage.html"><i class="fa fa-cab fa-fw"></i> 军事</a>
        </div>
    </div>
    <div class="table">
        <ul class="nav nav-pills nav-justified  border border-left-0 border-top-0 border-right-0" id="pills-tab" role="tablist">
            <!--所有-->
            <div class="col" style="background-color: #e9e7ff;" align="center">
                <a href="dailyPage.html"><i class="fa fa-reply-all fa-fw"></i> 所有</a>
            </div>
            <!--风景-->
            <div class="col" style="background-color: #2AFF30;" align="center">
                <a href="dailyPage1.html"><i class="fa fa-tree fa-fw"></i> 风景</a>
            </div>
            <!--美食-->
            <div class="col" style="background-color: #1D3ED5" align="center">
                <a href="dailyPage2.html"><i class="fa fa-apple fa-fw"></i> 美食</a>
            </div>
            <!--名人-->
            <div class="col" style="background-color: #FF5788" align="center">
                <a href="dailyPage3.html"><i class="fa fa-user fa-fw"></i> 名人</a>
            </div>
            <!--军事-->
            <a class="nav-link" id="celebrity-tab" data-toggle="pill" href="#militaries">
                军事
            </a>
        </ul>
        <div class="container tab-content carousel slide" id="dailyExampleControls"  data-ride="carousel">
            <div id="allDaily" class="carousel-inner" render-loop="list">
                <div class="carousel-item">
                    <div class="border commend">
                        <a href="travelContent.html" render-key="list.id" render-fun="handle">
                            <img render-src="list.coverUrl" width="100%" height="300px">
                            <h6 render-html="list.title"></h6>
                            <h6 render-html="list.releaseTime"></h6>
                        </a>
                    </div>
                </div>
            </div>

            <a class="carousel-control-prev" href="#dailyExampleControls" role="button" data-slide="prev">
                <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                <span class="sr-only"></span>
            </a>
            <a class="carousel-control-next" href="#dailyExampleControls" role="button" data-slide="next">
                <span class="carousel-control-next-icon" aria-hidden="true"></span>
                <span class="sr-only"></span>
            </a>
        </div>
    </div>
    <hr>

    <div class="container newList">
        <h6 class="module-title">骡窝日报 <a href="/newsPage.html">更多</a></h6>
        <div class="news " id="bigger" >
            <a href="/newsContent.html" render-key="id" render-fun="handle">
                <img width="100%" render-src="coverUrl">
                <div class="caption">
                    <h5 render-html="title"></h5>
                    <p render-html="subTitle">
                    </p>
                </div>
            </a>
        </div>

        <hr>
        <div class="container smaller">
        <div id="smaller" render-loop="list">
            <div style="margin-bottom: 20px">
                <a href="/newsContent.html" render-key="list.id" render-fun="handle">
                    <div class="row news-detail">
                        <div class="col-5">
                            <img render-src="list.coverUrl">
                        </div>
                        <div class="col-7">
                            <h4 render-html="list.title"></h4>
                            <p render-html="list.subTitle"></p>
                        </div>
                    </div>
                </a>
                <hr>
            </div>
        </div>
        </div>
    </div>
</div>
</body>
</html>